package com.mccrea.principle.likso.improve;

/**
 * @Classname LiksoAppMain1
 * @Description 采用
 * @Date 2021/5/6 0006 18:13
 * @Created by Mccrea_Gao
 */
public class LiksoAppMain1 {
    public static void main(String[] args) {

    }
}

class Base {

}

class A extends Base {
    public int func1(int num1, int num2) {
        return num1 - num2;
    }
}

class B extends Base {

    //使用组合关系
    private A a = new A();

    public int func1(int num1, int num2) {
        return num1 + num2;
    }

    public int func2(int num1, int num2) {
        return func1(num1, num2) + 9;
    }

    public int fun3(int num1, int num2) {
        return a.func1(num1, num2);
    }
}
